import { IParam, EntityBase } from "@/core";
import { IIBIZAPPCTRL } from './interface/i-ibizappctrl';
import IBIZAPPCTRLKeys from './ibizappctrl-keys';

/**
 * 应用部件基类
 * 基于template/src/api/{{appEntities}}/{{appEntities}}-base.ts.hbs生成  
 *
 * @export
 * @abstract
 * @class IBIZAPPCTRLBase
 * @extends { EntityBase }
 * @implements { IIBIZAPPCTRL }
 */
export abstract class IBIZAPPCTRLBase extends EntityBase implements IIBIZAPPCTRL {
	/**
	 * 实体名称
	 *
	 * @readonly
	 * @type {string}
	 * @memberof IBIZAPPCTRLBase
	 */
	get srfdename(): string {
		return 'IBIZAPPCTRL';
	}

	/**
     * 当前实体所有属性
     *
     * @protected
     * @type {string[]}
     * @memberof IBIZAPPCTRLBase
     */
    protected get keys(): string[] {
        return IBIZAPPCTRLKeys;
    }

	/**
	 * Creates an instance of ConstactOppoBase.
	 * @param {*} [data]
	 * @memberof IBIZAPPCTRLBase
	 */
	constructor(data?: any) {
		super();
		this.setData(data);
	}

	get srfmajortext(): string {
		return this.ibizappctrlname;
	}

	set srfmajortext(val: string) {
		this.ibizappctrlname = val;
	}
	/**
	 * 应用部件名称
	 **/
	ibizappctrlname?: any;
	
	get srfkey(): string {
		return this.ibizappctrlid;
	}

	set srfkey(val: string) {
		this.ibizappctrlid = val;
	}

	/**
	 * 应用部件标识
	 **/
	ibizappctrlid?: any;
	
	/**
	 * 更新时间
	 **/
	updatedate?: any;
	
	/**
	 * 建立时间
	 **/
	createdate?: any;
	
	/**
	 * 建立人
	 **/
	createman?: any;
	
	/**
	 * 更新人
	 **/
	updateman?: any;
	
	/**
	 * 应用部件类型
	 **/
	ibizappctrltype?: any;
	
	/**
	 * 部件描述
	 **/
	ctrldescription?: any;
	
	/**
	 * 文档地址
	 **/
	documentaddress?: any;
	
	/**
	 * 数量
	 **/
	amount?: any;
	

	/**
	 * 重置实体数据
	 *
	 * @param {IParam} [data={}]
	 * @memberof IBIZAPPCTRLBase
	 */
	reset(data: IParam = {}): void {
		super.reset(data);
		this.ibizappctrlname = data.ibizappctrlname || data.srfmajortext;
		this.ibizappctrlid = data.ibizappctrlid || data.srfkey;
	}
}